package spec.zhangyuehua.$04.example.e_4_15;

/**
 * Created by yue on 2017/10/25.
 */
public class StringBufferTest {
    public static void main(String[] args) {
        String s="Hello Java";
        StringBuffer sb=new StringBuffer();
        //链式编程
        /**
         * StringBuffer有个类方法叫append
         * 他的返回值也是StringBuffer
         * StringBuffer对象可以去访问类方法append
         */
        sb.append(s).append("你好，").append("Java");
        System.out.println(sb);
        sb.deleteCharAt(0);
        System.out.println(sb);
        s=sb.substring(0,11);
        System.out.println(s);
        sb.reverse();
        System.out.println(sb);
        sb.insert(4,"这是插入的字符");
        System.out.println(sb);

    }
}
